package com.toune.movie.mvp.adapter;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.toune.movie.R;
import com.toune.movie.mvp.activity.VarietyDetailActivity;
import com.toune.movie.vo.VarietyVo;
import com.vondear.rxui.view.RxRunTextView;

import java.util.List;

/**
 * Created by Administrator on 2018/5/11.
 * 综艺页面适配器
 */

public class AdapterVariety extends BaseQuickAdapter<VarietyVo, BaseViewHolder> {


    public AdapterVariety(int layoutResId, @Nullable List<VarietyVo> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, final VarietyVo data) {
        ImageView iconIv = holder.getView(R.id.icon_iv);
        RxRunTextView titleTv = holder.getView(R.id.title_tv);
        TextView pingfenTv = holder.getView(R.id.pingfen_tv);

        holder.setText(R.id.detail_tv, data.getDetaiText());
        Glide.with(mContext).load(data.getImagSrc()).apply(new RequestOptions().fitCenter().placeholder(R.mipmap.holder).error(R.mipmap.holder)).into(iconIv);
        titleTv.setText(data.getTitle());
        pingfenTv.setText(data.getPingfen());
    }
}
